package com.zpb.framework.domain.enums;

/**
 * @Description:
 * @Author: zhaopengbo
 * @Date: 2025/9/7
 */

public enum ResultCodeEnum {
    SUCCESS(200,"请求成功"),
    NO_USERNAME(400,"请求参数无效：用户名为必填字段，不能为空"),
    NO_PASSWORD(400,"请求参数无效，用户密码为必填字段，不能为空"),
    NO_NICKNAME(400,"请求参数无效，用户昵称为必填字段，不能为空"),
    NO_EMAIL(400,"请求参数无效，用户邮箱为必填字段，不能为空"),
    NO_ID(400,"请求参数无效，ID为必填字段，不能为空"),


    MISS_PARAM(400,"参数缺失"),

    USER_NO_LOGIN(401,"用户认证失败或未登录，请重新登录"),
    ERROR_USERNAME_OR_PASSWORD(505,"用户名或密码错误"),
    USER_NO_EXPRESSION(403,"权限不足"),
    EXIST_USERNAME(405,"该用户名已被注册"),
    EXIST_NICKNAME(406,"用户昵称已被使用"),
    EXIST_EMAIL(407,"该邮箱已被注册"),
    EXIST_PHONE(408,"手机号已被存在"),
    SYSTEM_ERROR(500,"系统错误"),
    NO_ARTICLE(410,"没有查询到文章"),
    NO_USER(411,"用户不存在"),
    NO_TAG(412,"标签不存在"),
    NO_MENU(413,"菜单不存在"),
    NO_ROLE(414,"角色不存在"),
    NO_CATEGORY(415,"分类不存在"),

    NOT_IMG(416,"文件类型错误，请上传正确的图片类型文件"),



    UNKNOWN_ERROR(510,"未知错误"),

    // 510开头表示数据库相关异常
    ADD_FAILURE(511,"数据添加失败"),
    DEL_FAILURE(512,"数据删除失败"),
    EXIST_CHILDREN_MENU(512,"该菜单下存在子菜单，不允许删除"),
    UPDATE_FAILURE(513,"数据更新失败"),
    CAN_NOT_DEL_SELF(515,"不能删除当前操作的用户");

    private String msg;
    private Integer code;

    ResultCodeEnum(Integer code, String Msg) {
        this.code = code;
        this.msg = Msg;
    }

    public String getMsg() {
        return msg;
    }
    public Integer getCode() {
        return code;
    }

}
